let arr = [[1, 3], [1, 13], [1, 2, 1]];  //=>[3,13,2]

let findMax = function (arr) {
    return arr.map(function (row) {
        return row.reduce(function (a, b) {
            return a > b ? a : b;
        });
    });
}
let findMax2 = function (arr) {
    return arr.map(function (row) {
        return row.sort(
            function (a, b) {
                return b - a;
            })[0];
    });
}

console.log("result=", findMax(arr));

console.log("result=", findMax2(arr));


for (let i = 0; i < arr.length; i++) {
    let s = "";
    for (let j = 0; j < arr[i].length; j++) {
        s += arr[i][j];
    }
    console.log(s);

}
